<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/1.css">
    <script src="../../../jQuery库/jquery-1.10.1.js"></script>
</head>
<body>
    <div class="wrap">
        <div class="biaoti">学生信息</div>
        <div class="ner">
            <!-- <div class="n1">
                <div><img src='../img/1.png'></div>
                <div>姓名:</div>
                <div>籍贯:</div>
                
            </div> -->
            
        </div>
        <button class='btn'>点击一下</button>
        <div class="wz">
          <!-- <ul>
              <li>1</li>
              <li>2</li>
              <li>3</li>
              <li>4</li>
              <li>5</li>
              <li>6</li>
              <li>7</li>
              <li>8</li>
              <li>9</li>
          </ul> -->
        </div>
    </div>
    <script>
        var $ner=$('.ner');
        var $n1=$('.n1');
        var $wz=$('.wz');
        console.log($ner);
        $.ajax({
            method: 'get',
            url: 'http://192.168.110.219:3000/search_info',
            success: function (data) {
                console.log(data);
                var dataArr=data.slice(0,10);
                console.log(dataArr);
                $.each(dataArr,function (index,el) {
                    $ner.append(`
                    <div class="n1">
                            <div><img src=${el.stu_head_img}></div>
                            <div>姓名:${el.stu_name}</div>
                            <div>籍贯:${el.stu_jg}</div>
                    </div>
                    `)
                })
            }
    })


    var $btn=$('.btn');
    $btn.click(function(){
        $.ajax({
            method: 'get',
            url: 'http://192.168.110.219:3000/search_entry/00',
            success: function (data) {
                console.log(data);
                var dataArr2=data.slice(0,1);
                console.log(dataArr2);
                $.each(dataArr2,function (index,el) {
                    el.zf=el.chinese * 1 + el.math * 1 + el.english * 1+ el.lizong*1+el.wenzong*1;
                    el.pj= Math.round(el.zf / 5);
                    $wz.append(`
                        <ul>
                            <li>${el.stu_id}</li>
                            <li>${el.stu_name}</li>
                            <li>${el.stu_jg}</li>
                            <li>${el.chinese}</li>
                            <li>${el.english}</li>
                            <li>${el.math}</li>
                            <li>${el.lizong}</li>
                            <li>${el.wenzong}</li>
                            <li>${el.zf}</li>
                            <li>${el.pj}</li>
                        </ul>
                    `)
                })
            }
        })

     })
    </script>
</body>
</html>